package org.sny7.openOfflineList.util;

import java.util.HashMap;

import javax.swing.Icon;
import javax.swing.ImageIcon;

import org.sny7.openOfflineList.bean.Game;

public class CountryIconKeeper {
	
	private static HashMap<Integer, Icon> iconMap = init();
	
	private CountryIconKeeper() {
	}
	
	private static HashMap<Integer, Icon> init() {
		HashMap<Integer, Icon> iconMap = new HashMap<Integer, Icon>();
		for (int i = 0; i < 26; i++) {
			iconMap.put(i, new ImageIcon(Game.class.getResource("/resources/countryFlags/" + i + ".gif")));
		}
		return iconMap;
	}
	
	public static Icon getIcon(int controyCode) {
		return iconMap.get(controyCode);
	}

}
